﻿using QG.JobBack.BLL.IService;
using QG.JobBack.DAL;
using QH.JobBack.Model;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QG.JobBack.BLL.Service
{
   public class UserinfoService : BaseRepository<UserInfo>, IUserinfoService
    {
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <param name="menu"></param>
        /// <returns></returns>
        public bool UpdateStatus(UserInfo userInfo)
        {
            using (var db = new qgpingEntities())
            {
                db.Configuration.ProxyCreationEnabled = false;
                UserInfo userInfos = db.UserInfo.FirstOrDefault(a => a.UserId == userInfo.UserId);
                userInfos.Status = userInfo.Status;    
                return db.SaveChanges() > 0;
            }
        }

    }
}
